package Segment_Tree_Basics;

/**
 * @author wly
 * @version V1.0.0
 * @date 2023/3/13 21:08
 */
public class Main {
    public static void main(String[] args) {
        Integer[] nums = {-2, 0, 3, -5, 2, -1};
        SegmentTree<Integer> segTree = new SegmentTree<>(nums, new Merger<Integer>() {
            @Override
            public Integer merge(Integer a, Integer b) {
                return a + b;
            }
        });
//        System.out.println(segTree);
        Integer res = segTree.query(0, 2);
        System.out.println(res);
    }
}
